<template>
  <div class="mine">
    <div class="login" v-if="userInfo">
      <div class="headrPic">
        <img :src="headerImg" alt="" />
      </div>
      {{ userName }}
    </div>
    <div class="nolgin" v-else>未登录</div>
  </div>
</template>

<script setup>
import { ref, onMounted } from 'vue'

const userInfo = JSON.parse(localStorage.getItem('userInfo'))

const headerImg = ref(userInfo?.profile.avatarUrl)
const userName = ref(userInfo?.profile.signature)
</script>

<style scoped lang="scss">
.headrPic {
  width: 100px;
  height: 100px;
  img {
    height: 100%;
    width: 100%;
  }
}
</style>
